package com.cx.mall.demo.service;

import java.util.List;

public interface IBaseService <T>{
    /**
     * 保存数据
     * @param entity
     */
    void save(T entity) throws Exception;

    /**
     * 修改数据
     * @param entity
     */
    void update(T entity) throws Exception;

    /**
     * 删除数据
     * @param id
     */
    void removeById(Long id) throws Exception;

    /**
     * 按Id查询
     * @param id
     */
    T getById(Long id) throws Exception;

    /**
     * 按条件查询
     * @param params
     * @return
     */
    T getOne(Object... params) throws Exception;

    /**
     * 按条件查询
     * @param params
     * @return
     */
    List<T> list(Object... params) throws Exception;
}
